/**
 * @(#)HttpUtil.java 1.0.0 2014年10月20日 上午11:45:34
 * <p>
 * Copyright © 2014 善林金融.  All rights reserved.
 */

package com.jic.market.common.util;

import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author guohuayong
 * @date: 2020年01月15日
 */
@Component
public class HttpServletUtil {
	public static HttpServletRequest getRequest() {
		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
				.getRequest();
	}
	public static HttpServletResponse getResponse() {
		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
				.getResponse();
	}
}
